package test0927;

public class Car {
    private String color;
    private String number;

    public Car() {
    }

    public Car(String color, String number) {
        this.color = color;
        this.number = number;
    }




    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public boolean equals(Object o){
        if (this==o){
            return true;
        }
        if (o instanceof Car){
            Car car = (Car) o;
            if (this.color.equals(car.getColor())&&this.number.equals(car.getNumber())){
                return true;
            }
        }
        return false;
    }

    @Override
    public String toString() {
        return "Car{" +
                "color='" + color + '\'' +
                ", number='" + number + '\'' +
                '}';
    }
}


